<?php if (!defined('THINK_PATH')) exit(); if(is_array($category)): foreach($category as $key=>$i): ?><a type="button" class="btn btn-default btn-primary" href="<?php echo U('Index/Category',array('id'=>$i['id']));?>">
        <?php echo ($i['cname']); ?></a>&nbsp;&nbsp;<?php endforeach; endif; ?>